package org.springcloud.wisdom.springcloud_03_freshman.admin.controller;

import org.springcloud.wisdom.springcloud_03_freshman.admin.service.AdminGoodsService;
import org.springcloud.wisdom.springcloud_03_freshman.common.bean.ResponseData;
import org.springcloud.wisdom.springcloud_03_freshman.common.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/goods")
public class AdminGoodsController extends BaseController {
    @Autowired
    AdminGoodsService adminGoodsService;

    @GetMapping("/all")
    public ResponseData<Object> goodsPage(
            @RequestParam("pageNum") int pageNum,
            @RequestParam("pageSize")int pageSize,
            @RequestParam(value = "receiveStatus",required = false)String receiveStatus,
            @RequestParam(value = "dept",required = false)Integer dept
    ){
        return returnObject(adminGoodsService.getGoodsPage(pageNum, pageSize, receiveStatus, dept));
    }
}
